frailtyPenal :
- The first one (Rondeau et al. 2007) includes a common frailty term to the individuals $(\omega_i)$ for the two rates which will take into account the heterogeneity in the data, associated with unobserved covariates. The frailty term acts differently for the two rates ( $\omega_i$ for the recurrent rate and $\omega_i^{\alpha}$ for the death rate). The covariates could be different for the recurrent rate and death rate.
For the $j^{th}$ recurrence $(j=1,...,n_i)$ and the $i^{th}$ subject $(i=1,...,G)$, the joint model for recurrent event hazard function $r_{ij}(.)$ and death rate $\lambda_i(.)$ is :
$$\left{
\begin{array}{ll}
r_{ij}(t|\omega_i)=\omega_ir_0(t)\exp(\bold{\beta_1^{'}Z_i(t)}) & \mbox{(Recurrent)} \
\lambda_i(t|\omega_i)=\omega_i^{\alpha}\lambda_0(t)\exp(\bold{\beta_2^{'}Z_i(t)}) & \mbox{(Death)} \
\end{array}
\right.$$
where $r_0(t)$ (resp. $\lambda_0(t)$) is the recurrent (resp. terminal) event baseline hazard function, $\bold{\beta_1}$ (resp. $\bold{\beta_2}$) the regression coefficient vector, $\bold{Z_i(t)}$ the covariate vector. The random effects of frailties $\omega_i\sim\bold{\Gamma}(\frac{1}{\theta},\frac{1}{\theta})$ and are iid.
- The second one (Rondeau et al. 2011) is quite similar but the frailty term is common to the individuals from a same group. This model is useful for joint modelling two clustered survival outcomes. In this case, j is for the subject and i for the cluster.
$$\left{
\begin{array}{ll}
r_{ij}(t|u_i)=u_ir_0(t)\exp(\bold{\beta_1^{'}Z_{ij}(t)}) & \mbox{(Time to event)} \
\lambda_{ij}(t|u_i)=u_i^{\alpha}\lambda_0(t)\exp(\bold{\beta_2^{'}Z_{ij}(t)}) & \mbox{(Death)} \
\end{array}
\right.$$
This joint frailty model can also be applied to clustered recurrent events and a terminal event (example on "readmission" data below).kappa2, a solution is to fit the corresponding Cox model using cross-validation (See cross.validation) summary.jointPenal,
print.jointPenal,
plot.jointPenal,
readmission,
terminal,
cluster### Joint model (recurrent and terminal events) with 2 covariates ###
### on a simulated dataset ###
data(readmission)
### Joint Frailty model ###
## Gap-time ##
modJoint_gap<-frailtyPenal(Surv(time,event)~cluster(id)+sex+as.factor(dukes)
+as.factor(charlson)+terminal(death),
formula.terminalEvent=~sex+as.factor(dukes)+as.factor(charlson),
data=readmission,n.knots=14,kappa1=9550000000,kappa2=1410000000000,
Frailty=TRUE,joint=TRUE,recurrentAG=FALSE)
## Calendar time ##
modJoint_calendar<-frailtyPenal(Surv(t.start,t.stop,event)~cluster(id)+sex
+as.factor(dukes)+as.factor(charlson)+terminal(death),
formula.terminalEvent=~sex+as.factor(dukes)+as.factor(charlson),
data=readmission,n.knots=10,kappa1=9550000000,kappa2=1410000000000,
Frailty=TRUE,joint=TRUE,recurrentAG=TRUE)
print(modJoint_gap)
summary(modJoint_gap)
plot(modJoint_gap)
print(modJoint_calendar)
summary(modJoint_calendar)
plot(modJoint_calendar)
# A model takes around 1 minute to converge #
### Joint Frailty model for clustered data ###
# here is a generated cluster (31 clusters of 13 subjects)
readmission <- transform(readmission,group=id%%31+1)
joi.clus <- frailtyPenal(formula = Surv(t.start, t.stop, event) ~ cluster(group) +
num.id(id) + dukes + charlson + sex + chemo + terminal(death),
formula.terminalEvent = ~dukes + charlson + sex + chemo,
data = readmission, Frailty = TRUE, joint = TRUE, recurrentAG = TRUE,
n.knots = 10, kappa1 = 2.11e+08, kappa2 = 9.53e+11)Run the code above in your browser using DataLab